Add option --forceflush
to force flushing of output at the end of each interval
#377
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #299
As discussed in issue #299 piping the output of iperf to another process, introduces buffering in output and delay in receiving updates by the other process.
This can be fixed by using tools like unbuffer, expect and stdbuf on UNIX/Linux, but those tools are not easy to get to work in Windows.
This pull request adds a command line option named --forceflush, that allows the user to request flushing of output at the end of each interval. That way users can take advantage of this option, if (and only if) buffering output (eg. when piping output) is a problem in their specific case, without the necessity of relying on external tools.
Similar problem existed when piping output to a file. The file was not updated fast enough and could not be monitored in realtime. Pull #272 fixed that by calling iflush on iprintf in interval.
Current pull request uses the same approach, but adds a command line option named --forceflush (optional), that can be used to force flushing, even if not logging output to file.